import { MockMethod } from 'vite-plugin-mock';
import { mock } from 'mockjs';
import { resultSuccess } from '../_util';

const projectList = mock({
  'data|30': [
    {
      title: '@ctitle(6)',
      icon: 'ion:logo-vue',
      color: '#3fb27f',
      num: '@integer(0, 10)',
      module: '@ctitle(4)',
      'route|1': ['/shop/order/pageTodoPay', ''],
    },
  ],
});

export default [
  {
    url: '/mock-api/workbench/project/list',
    timeout: 1000,
    method: 'get',
    response: () => {
      return resultSuccess({ list: projectList.data.slice(0, 6) });
    },
  },
] as MockMethod[];
